import 'package:cms/cms.dart';
import 'package:common/export/tools.dart';
import 'package:larapress_app/navigation/navigation.dart';
import 'package:larapress_app/pages/home/home_page.dart';

GoRouter laraPressAppRouter = GoRouter(routes: _buildRoutes());

List<RouteBase> _buildRoutes() {
  final routes = <RouteBase>[
    GoRoute(
      path: '/',
      name: 'navigation',
      builder: (context, state) => const Navigation(),
      routes: [
        GoRoute(
          path: '/',
          name: 'home',
          builder: (context, state) => const LaraPressHomePage(),
        ),
      ],
    ),
    // 主APP的路由
  ];
  // 注册CMS插件的路由
  LaraPressCms.registerRoutes(routes);

  return routes;
}
